<?php
/**
 * TestGuest Version1.0
 * ================================================
 * Copy 2017-2018 zxj
 * Web: http://www.zhaoxiaojie.club
 * ================================================
 * Author: Zxj
 * Date: 17/8/9
 * Time: 下午4:14
 * 项目入口文件
 *
 */
session_start();
//1、设置响应头信息
header('Content-type:text/html; charset=utf-8');
//2.引入初始化文件
include 'common/ini.php';
include 'common/mysql.inc.php';
include 'common/config.inc.php';

//获取热门动态数据
$sql1 = "select * from bbs_news ORDER BY id ASC limit 6";
$res1 = mysql_query($sql1);
while($rows1 = mysql_fetch_assoc($res1)) {
    $data[] = $rows1;
}
//获取所有版块数据
//	$sql2 = "select * from bbs_forum ORDER BY sort ASC";
//	$res2 = mysql_query($sql2);
//	while($rows2 = mysql_fetch_assoc($res2)){
//			$modul[] = $rows2;
//	}

//获取子版块数据
//$sql3 = "select * from bbs_forum WHERE pid = '$id'";

//获取主版块数据
$sql4 = "select * from bbs_forum WHERE pid=0 ORDER BY sort ASC";
$res4 = mysql_query($sql4);
while($rows4 = mysql_fetch_assoc($res4)){
    $modul4[] = $rows4;
}
//3.载入index.html模板
include VIEW.'/index.html';
?>